package com.shiguiwu.springboot3.java11;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

import java.util.List;

/**
 * @description:
 * @author: stone
 * @date: Created by 2023/7/9 23:25
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springboot3.java11
 */
@Slf4j
public class Java11Tests {

    /**
     * 字符串特性
     */
    @Test
    public void testString() {

        String a = "Aa";

        //判空
        log.info("aaa ==> {}", a.isBlank());

        //重复
        log.info("重复 ===> {}", a.repeat(4));

        String str = "foo\nbar\nbaz";
        str.lines().forEach(System.out::println); // 输出 foo，bar 和 baz

    }

    /**
     * 集合
     */
    @Test
    public void testCollect() {

        List<Integer> list = List.of(1, 23, 4);

        list.toArray(Integer[]::new);
    }

    /**
     * 新的变量var
     */
    @Test
    public void testVar() {

        var i = "aa";

        log.info("aaa ==> {}",i);
        var j = 2;

        var o = new Object();
    }


}
